<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取要提交的信息</title>
</head>
<body>
<div>
    <form  action="post">
        <p>
            <span>用户名：</span><input type = "text" id = "username">
        </p>
        <p>
            <span>性别:</span>
            <input type ="radio" name = "sex" value="man" id="boy">男
            <input type ="radio" name = "sex" value="women" id="girl">女
        </p>
        <button type="submit">提交</button>
    </form>
    <script >
        'use strict'
        var input_text = document.getElementById('username');
        var boy_radio = document.getElementById('boy')
            //对于单选框，多选框等等固定的值，boy_radio.value只能获取当前的值，不能获取选中的值
    // 查看选中的结果，用checked判断是true还是false

    </script>
</div>
</body>
</html>